#pragma once
#include<iostream>
#include<string>

namespace bit
{
    class AddTask
    {
    private:
        void _printResult()
        {
            std::cout << std::to_string(_x) << "+" << std::to_string(_y) << "=" << std::to_string(_result) <<std::endl;
        }
    public:
        //构造函数：
        AddTask(int x = 0, int y = 0):_x(x), _y(y){}

        int operator()()
        {
            _result = _x +_y;
            _printResult();
            return _result;
        }
        void debug()
        {
            std::cout << std::to_string(_x) << "+" << std::to_string(_y) << "=?" << std::endl;
        }
    private:
        int _x;
        int _y;
        int _result;
    };
}